package com.qqt.csr.common.sensitiveword;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class SensitiveWordMsg implements Serializable {
    @Serial
    private static final long serialVersionUID = -2031478941323541978L;

    /**
     * 显示规则：0 星号加密；1 敏感词高亮
     */
    private Integer showType;

    /**
     * 敏感词起始位置
     */
    private Integer sidx;
    /**
     * 敏感词结束位置
     */
    private Integer eidx;

    public static SensitiveWordMsg of(Integer showType, Integer sidx, Integer eidx) {
        return SensitiveWordMsg.builder()
                .showType(showType)
                .sidx(sidx)
                .eidx(eidx)
                .build();
    }
}
